﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TomMaton.Umbraco.AmazonS3
{
    public class amazonS3DataType : umbraco.cms.businesslogic.datatype.BaseDataType, umbraco.interfaces.IDataType
    {
        private umbraco.interfaces.IDataEditor _Editor;
        private umbraco.interfaces.IData _baseData;
        private amazonS3PrevalueEditor _prevalueeditor;

        public override umbraco.interfaces.IDataEditor DataEditor
        {
            get
            {
                if (_Editor == null)
                    _Editor = new amazonS3DataEditor(Data, ((amazonS3PrevalueEditor)PrevalueEditor).Configuration);

                return _Editor;
            }
        }

        public override umbraco.interfaces.IData Data
        {
            get
            {
                if (_baseData == null)
                    _baseData = new umbraco.cms.businesslogic.datatype.DefaultData(this);

                return _baseData;
            }
        }

        public override Guid Id
        {
            get { return new Guid("75A67FD2-9B16-11DE-958A-F78856D89593"); }
        }

        public override string DataTypeName
        {
            get { return "Amazon S3 (Simple Storage Service)"; }
        }

        public override umbraco.interfaces.IDataPrevalue PrevalueEditor
        {
            get
            {
                if (_prevalueeditor == null)
                    _prevalueeditor = new amazonS3PrevalueEditor(this);

                return _prevalueeditor;
            }

        }
    }
}
